<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title style="font-family: Microsoft yahei;">Regular expression help document</title>
		<script type="text/javascript" src="../js/jquery.min.js"></script>
		<style type="text/css">
			table{
				border-collapse: collapse;
				border-spacing: 2px;
    			border-color: grey;
    			overflow: visible;
    			display: block;
    			font-family: "Microsoft yahei";
			}
			td {
				height: 26px;
			    border-bottom: 0;
			    font-size: 14px;
			    text-align: left;
			    word-break: break-all;
			    border: 1px solid #dddddd;
			    line-height:2em;
			}
			tr {
				height: 26px;
			    border-bottom: 0;
			    font-size: 12px;
			    text-align: left;
			    border: 1px solid #dddddd;
			}
			th {
				text-align: center;
			    font-size: 12px;
			    font-weight: bold;
			    word-break: keep-all;
			    white-space: nowrap;
			    border: 1px solid #dddddd;
			}

		</style>
		<script>
			$.ajax({
				url:"/cloud-system-manage/certificate/get-tag-image",
				type:'post',
				dataType:'json',
				success:function(res){
					if(res.status==1 && res.data != "" && res.data != null ){
						$("<link rel='shortcut icon'/>").attr("href","data:image/x-icon;base64," + res.data).appendTo($("head"))
					}else{ $("<link rel='shortcut icon' href='/portal/favicon.ico' type='image/x-icon'/>").appendTo($("head"))}
				}
			})
		</script>
	</head>
	<body style="font-family: Microsoft yahei;">
		<div style="width:100%">
			<h2>Regular Expression</h2>
			<p style="text-indent:2em;line-height:2em;font-family: Microsoft yahei;">Regular expression describes a pattern of matching strings. It could be used to check whether a sequence contains a certain subsequence, extract matching subsequences or replace them. Regular expressions consist of regular characters (e.g. a to z) and special characters (metacharacter).  As a pattern, regular expressions match a specific pattern with strings in a search.</p>
			<table>
				<thead>
					<tr style="background: lightskyblue;"><th style="width:100px;">Character</th><th>Description</th></tr>
				</thead>
				<tbody>
					<tr><td>\</td><td>Mark the following character as a special character, or a literal character, or a backward citation, or a 8-bit escape character. e.g. “n” matches the character “n”. “\n” matches a line break. Sequence “\\” matches “\” and “\(“ matches “(“.</td></tr>
					<tr><td>^</td><td>Matching the starting position of the string. If the Multiline option of the regular expression (RegExp in short) object is set, ^also matches the following position of “\n” or “\r”.</td></tr>
					<tr><td>$</td><td>Matching the ending position of the string. If the Multiline option of the regular expression (RegExp in short) object is set, ^also matches the preceding position of “\n” or “\r”.</td></tr>
					<tr><td>*</td><td>Matching the preceding subsequence zero or multiple times. e.g. zo* could match with “z” and “zoo”. “*” is equivalent to {0,}</td></tr>
					<tr><td>+</td><td>Matching the preceding subsequence once or multiple times. e.g. zo* could match with “z” and “zoo” but not “z”. “+” is equivalent to {1,}</td></tr>
					<tr><td>?</td><td>Matching the preceding subsequence once or zero time. e.g. do(es)? could match with “does” or “do” in “does” but not “z”. “?” is equivalent to {0,1}</td></tr>
					<tr><td>{n}</td><td>n is a non-negative integer indicating the number of matches. E.g. “o{2}”can’t match with “o” in “Bob”, but can match with the double “o” in “food”. </td></tr>
					<tr><td>{n,}</td><td>n is a non-negative integer indicating the least number of matches. E.g. “o{2,}”can’t match with “o” in “Bob”, but can match with the all “o”s in “fooooooood”. </td></tr>
					<tr><td>{n,m}</td><td>m and n are both non-negative integers, where n<=m. Match at least n times and at most m times. e.g. “o{1,3}” would match the first 3 “o”s in “fooooood”. “o{0,1}” is equivalent to “o?”. Please note that there is no spaces between the two numbers and the comma. </td></tr>
					<tr><td>(pattern)</td><td>Match pattern and capture the matching result. The result could be accessed in the generated Matches group, use SubMatches in VBScript and option $0…$9 in Jscript. If you want to match with curly brackets, please use“\(”or“\)”. </td></tr>
					<tr><td>(?:pattern)</td><td>Match pattern but don’t capture the result, which means it’s a non-capturing matching and won’t be stored for further use. It’s very useful when using the or character“(|)”to form parts of a mode. E.g. “industry(?:y|ies)”is a much simpler expression than“industry|industries”. </td></tr>
					<tr><td>(?=pattern)</td><td>Positive lookahead match at the starting point of the string that matches with pattern. It’s a non-capturing matching, which means the match doesn’t need to be captured for further use. E.g. “Windows(?=95|98|NT|2000)”can match with the“Windows”in“Windows2000”but not“Windows”in“Windows3.1”. Lookahead consume no character in string, which means after one match, the next match will start immediately after the last match, instead of starting from the character containing the lookahead.</td></tr>
					<tr><td>(?!pattern)</td><td>Negative lookahead match at the starting point of the string that doesn’t match with pattern. It’s a non-capturing matching, which means the match doesn’t need to be captured for further use. E.g. “Windows(?!95|98|NT|2000)”can match with the“Windows”in“Windows3.1”but not“Windows”in“Windows2000”. Lookahead consume no character in string, which means after one match, the next match will start immediately after the last match, instead of starting from the character containing the lookahead. </td></tr>
					<tr><td>(?<=pattern)</td><td>Positive lookbehind, similar to positive lookahead, but in the reverse order. E.g. “(?<=95|98|NT|2000)Windows could match the“Windows”in“2000Windows”but not“Windows”in“3.1Windows”</td></tr>
					<tr><td>x|y</td><td>Match x or y. e.g. “z|food”could match“z”or“food”, “(z|f)ood”match with“zood”or“food”. </td></tr>
					<tr><td>[xyz]</td><td>Set of characters. Match with any arbitrary character contained. E.g. “[abc]”could match“a”in“plain”.</td></tr>
					<tr><td>[^xyz]</td><td>Negative set of characters. Match with any arbitrary character not contained. E.g. “[^abc]”could match“p”in“plain”.</td></tr>
					<tr><td>[a-z]</td><td>Range of characters. Match any arbitrary character in the given range. E.g. “[a-z]”could match any lowercase letter between “a” and “z”</td></tr>
					<tr><td>[^a-z]</td><td>Negative range of characters. Match any arbitrary character not in the given range. E.g. “[a-z]”could match any lowercase letter not between “a” and “z”</td></tr>
					<tr><td>\b</td><td>Match a boundary of word, which means the position between space and a word. E.g. er\b”could match the“er”in“never”but not the“er”in“verb”.</td></tr>
					<tr><td>\B</td><td>Match a non-boundary of word. E.g. er\b”could match the“er”in“verb”but not the“er”in“never”.</td></tr>
					<tr><td>\cx</td><td>Match the control character indicted by x. e.g. \cM matches with a Control-M or carriage return. X have to be one of A-Z or a-z. Or c would be seen as a c of its original meaning.</td></tr>
					<tr><td>\d</td><td>Match a numerical character, equivalent to [0-9].</td></tr>
					<tr><td>\D</td><td>Match a non-numerical character, equivalent to [^0-9].</td></tr>
					<tr><td>\f</td><td>Match a page break, equivalent to \x0c and \cL.</td></tr>
					<tr><td>\n</td><td>Match a line break, equivalent to \x0a and \cJ.</td></tr>
					<tr><td>\r</td><td>Match a carriage return, equivalent to \x0d and \cM.</td></tr>
					<tr><td>\s</td><td>Match any blank character, including space, tab, page break, etc. equivalent to [\f\n\r\t\v].</td></tr>
					<tr><td>\S</td><td>Match any non-blank character, including space, tab, page break, etc. equivalent to [^ \f\n\r\t\v].</td></tr>
					<tr><td>\t</td><td>Match a tab, equivalent to \x09c and \cI.</td></tr>
					<tr><td>\v</td><td>Match a vertical tab, equivalent to \x0b and \cK.</td></tr>
					<tr><td>\w</td><td>Match any letter character including underline, equivalent to [A-Za-z0-9_].</td></tr>
					<tr><td>\W</td><td>Match any non-letter character excluding underline, equivalent to [^A-Za-z0-9_].</td></tr>
					<tr><td>\xn</td><td>Match n, where n is a hexadecimal escape character. The hexadecimal escape character has to be in the length of two numbers. E.g.”\x41”match “A”. “\x041”is equivalent to”\x04&1”. ASCII code is available in RegExp.</td></tr>
					<tr><td>\num</td><td>Match num, where num is a positive integer. It’s the citation of the matching result. E.g.”(.)\1”matches two consecutive identical characters.</td></tr>
					<tr><td>\n</td><td>Mark an octal escape character or a backward citation. If there are at least n preceding capturing sub-expressions, n is a backward citation, else if n is an octal number, and then n is an octal escape character.</td></tr>
				    <tr><td>\nm</td><td>Mark an octal escape character or a backward citation. If there are at least nm preceding capturing sub-expressions, then nm is a backward citation; if there are at least n capturing sub-expressions, then n is a backward citation followed by a letter m. If neither of those are satisfied, if n and m are both octal numbers(0-7), then \nm would match an octal escape character value nm.</td></tr>
					<tr><td>\nml</td><td>If n is an octal number(0-3), and m and l are both octal numbers(0-7), then match octal escape character value nml。</td></tr>
					<tr><td>\un</td><td>Match n, where n is a Unicode character consists of four hexadecimal numbers. E.g. \u00A9 match the copyright character.(©)</td></tr>
				</tbody>
			</table>
		</div>
	</body>
</html>